// components/CustomGoodsItem.js
const {
  getImageUrl
} = require("../../utils/util")
Component({
  /**
   * 组件的属性列表
   */
  options: {
    addGlobalClass: true
  },
  properties: {
    commodity: {
      type: () => ({})
    }
  },
  lifetimes: {

  },
  observers: {
    "commodity": function (newV) {
      this.setData({
        commodity_com: {
          ...newV,
          cover: newV.covers[0] ? getImageUrl(newV.covers[0]) : ""
        }
      })
    }
  },
  /**
   * 组件的初始数据
   */
  data: {
    commodity_com: []
  },

  /**
   * 组件的方法列表
   */
  methods: {

  }
})